package org.springblade.modules.repair.vo.elevator;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.repair.entity.MaintainCheckRecord;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zcc
 * @version 1.0
 * @date 2023/10/30 17:09
 */
@Data
public class ElevatorPartWorkVo {


	private Long id;

	@ApiModelProperty("工单类型")
	private Integer typeStatus;

	@ApiModelProperty("创建时间")
	private Date createTime;

	private Long planId;

	@ApiModelProperty("工作项名称")
	private String workName;

	@ApiModelProperty("工单类型名称半月保养，配件等")
	private String checkName;


	//保养相关
	@TableField(typeHandler = JacksonTypeHandler.class)
	private JSONObject recordData;

	private Integer result;

	private List<JSONObject> recordDataValues;

	private List<String> imgUrl;

	private List<MaintainCheckRecord> records;


	//维修相关 图片
	@TableField(typeHandler = JacksonTypeHandler.class)
	private List<HashMap<String,String>> disposeImgUrl;

	//描述
	private String disposeDesc;

	private String problemItem;

	private String problemOtherDesc;

	private List<String> problemItemNames;

	private String partsNames;

	private String floorStandIds;

	private String floorStandNames;

	public void setPartsNames(String partsNames) {
		if(Func.isNotEmpty(partsNames)){
			this.partsNames = partsNames.replace("&amp;&amp;",">");
		}
	}

	public void setFloorStandNames(String floorStandNames) {
		if(Func.isNotEmpty(floorStandNames)){
			this.floorStandNames = floorStandNames.replace("&amp;&amp;",">");
		}
	}
}
